#include "sms.h"

#define LINVIDEO_LAYOUT_NAME "layout-linvideo"
#define LINVIDEO_CHANNEL_MAX 128

typedef struct _ChannelItem{
	char *name;
	char *url;

	struct _ChannelItem *next;
}ChannelItem;

typedef struct _Channel{
	char *name;
	GdkPixbuf *pic;
	int item_count;
	ChannelItem *item;
}Channel;


typedef struct _Linvideo
{
	GooCanvasItem *bg;
	Channel* channel[LINVIDEO_CHANNEL_MAX];
	
}Linvideo;



//////////////////////////////////////////////////////////////////////

gboolean linvideo_init(Layout *layout,gpointer data)
{
	printf("call %s\n",__FUNCTION__);
	SMS *sms=layout->sms;
	GdkPixbuf *pixbuf;
	Linvideo *linvideo=(Linvideo *)g_malloc0(sizeof(Linvideo)+1);
	
	layout->private=(void *)linvideo;

	layout->cavas = goo_canvas_group_new(layout->parent,NULL);	

	pixbuf=sms->theme->pic[THEME_PIC_LAYOUT_BG];
	linvideo->bg=goo_canvas_image_new(layout->cavas,pixbuf,0,0,NULL);
#if 0
	if(!linvideo_load_config(layout))
	{
		fprintf(stderr,"%s:load config err\n",__FUNCTION__);
		return FALSE;//exit(-1);
	}
#endif
	
	return TRUE;
}

gboolean linvideo_clear(Layout *layout,gpointer data)
{
	
	return TRUE;
}

gboolean linvideo_key_press(Layout * layout,GdkEventKey *event)
{
	return FALSE;
}

Layout *linvideo_layout_new(GooCanvasItem * parent,gpointer sms)
{
	Layout *layout=layout_new( parent,LAYOUT_TYPE_WIN,LAYOUT_WIN_LINVIDEO,
							   LINVIDEO_LAYOUT_NAME,sms);

	layout_set_func(layout,"init",linvideo_init);
	layout_set_func(layout,"clear",linvideo_clear);
	layout_set_func(layout,"key-press",linvideo_key_press);
	printf("%s:layout=%p\n",__FUNCTION__,layout);
	return layout;
}
